﻿namespace Jumpton.SFA.Server.Entity
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using Jumpton.Persistent;
    using System.Data;


    [Map("PRODUCT_UOMS")]
    public class PRODUCT_UOMS : ObjectRow
    {

        public PRODUCT_UOMS()
        {
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataRow">DataTable 中的一行数据</param>
        /// <param name="objectTable">存储当前对象的数据表格</param>
        public PRODUCT_UOMS(System.Data.DataRow dataRow, ObjectTable parent) :
            base(dataRow, parent)
        {
        }

        [Key("ID", true, true)]//主键,对应数据库中的列名
        public int ID
        {
            get { return (int)GetValue("ID"); }
            set { SetValue("ID", value); }
        }

        [Field("PRODUCT_ID")]
        public decimal PRODUCTID
        {
            get
            {
                return (System.Decimal)GetValue("PRODUCTID");
            }
            set
            {
                SetValue("PRODUCTID", value);
            }
        }

        [Field("UOM_CODE")]
        public string UomsCode
        {
            get
            {
                return (System.String)GetValue("UomsCode");
            }
            set
            {
                SetValue("UomsCode", value);
            }
        }

        [Field("DENOMINATOR")]
        public decimal DENOMINATOR
        {
            get
            {
                return (System.Decimal)GetValue("DENOMINATOR");
            }
            set
            {
                SetValue("DENOMINATOR", value);
            }
        }

        [Field("WEIGHT")]
        public decimal WEIGHT
        {
            get
            {
                return (System.Decimal)GetValue("WEIGHT");
            }
            set
            {
                SetValue("WEIGHT", value);
            }
        }

        [Field("VOLUME")]
        public decimal VOLUME
        {
            get
            {
                return (System.Decimal)GetValue("VOLUME");
            }
            set
            {
                SetValue("VOLUME", value);
            }
        }

        [Field("DOMAIN_ID")]
        public decimal DOMAINID
        {
            get
            {
                return (System.Decimal)GetValue("DOMAINID");
            }
            set
            {
                SetValue("DOMAINID", value);
            }
        }


        [Field("LAST_UPDATER")]
        public string LAST_UPDATER
        {
            get
            {
                return (System.String)GetValue("LAST_UPDATER");
            }
            set
            {
                SetValue("LAST_UPDATER", value);
            }
        }

        [Field("LAST_UPDATE_TIME")]
        public long LAST_UPDATE_TIME
        {
            get
            {
                return (long)GetValue("LAST_UPDATE_TIME", DateTime.Now);
            }
            set
            {
                SetValue("LAST_UPDATE_TIME", value);
            }
        }

        [Field("CREATE_TIME")]
        public long CREATETIME
        {
            get
            {
                return (long)GetValue("CREATETIME", DateTime.Now);
            }
            set
            {
                SetValue("CREATETIME", value);
            }
        }

        [Field("ACTIVE")]
        public Boolean ACTIVE
        {
            get
            {
                return (System.Boolean)GetValue("ACTIVE", false);
            }
            set
            {
                SetValue("ACTIVE", value);
            }
        }

        [Field("SELL_FLAG")]
        public string SELLFLAG
        {
            get
            {
                return (System.String)GetValue("SELLFLAG");
            }
            set
            {
                SetValue("SELLFLAG", value);
            }
        }

        [Field("CS_NAME")]
        public string CSNAME
        {
            get
            {
                return (System.String)GetValue("CSNAME");
            }
            set
            {
                SetValue("CSNAME", value);
            }
        }


        [Field("PC_NAME")]
        public string PCNAME
        {
            get
            {
                return (System.String)GetValue("PCNAME");
            }
            set
            {
                SetValue("PCNAME", value);
            }
        }

     

        [CalculateField]
        public bool IsSell
        {
            get
            {
                return (System.String)GetValue("SELLFLAG") == "1" ? true : false;
            }
        }
    }
}
